<template>
    <div>
        <!--面包屑导航-->
        <el-breadcrumb :separator-icon="ArrowRight">
            <el-breadcrumb-item :to="{ path: '/administerhome' }" class="breadCrumb">首页
            </el-breadcrumb-item>
            <el-breadcrumb-item>公告管理</el-breadcrumb-item>
        </el-breadcrumb>
        <!-- 公告管理主界面 -->
        <el-card class="notice-management-main">
            <div class="operater-bar">
                <!--输入和选择区域-->
                <div class="input-select-field">
                    <div>
                        <el-text class="mx-1">公告标题：</el-text>
                        <el-input placeholder="请输入公告的标题" />
                    </div>
                </div>
                <!--按钮区域-->
                <div class="btn-field">
                    <el-button type="primary">搜索</el-button>
                    <el-button type="primary" @click="iseditdialogVisiable">新增</el-button>
                </div>

            </div>
            <div class="table-field">
                <el-table :data="tableData" border stripe style="width: 100%">
                    <el-table-column prop="title" label="标题" class="col-title" />
                    <el-table-column prop="content" label="内容概述" />

                    <el-table-column prop="operator" label="操作" width="200">
                        <template #default>
                            <el-button type="primary" size="small">
                                详情
                            </el-button>
                            <el-button type="primary" size="small" color="red">
                                删除
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </el-card>


        <!-- 编辑公告界面 -->
        <!--          
        <el-dialog v-model="editdialogVisiable">
            <el-card class="notice-main">
            <el-form :model="form" label-width="auto" style="max-width: 100%">
                <el-form-item label="标题">
                    <el-input v-model="form.name" />
                </el-form-item>
                <el-form-item label="图片">
                    <el-select v-model="form.region" placeholder="请选择一张图或者填写其他地址">
                        <el-option label="普通公告图" />
                        <el-option label="紧急公告图" />
                    </el-select>
                </el-form-item>
                <el-form-item label="时间">
                    <el-col :span="11">
                        <el-date-picker v-model="form.date1" type="date" placeholder="选择日期" style="width: 100%" />
                    </el-col>
                    <el-col :span="2" class="text-center">
                        <span class="text-gray-500">-</span>
                    </el-col>
                    <el-col :span="11">
                        <el-time-picker v-model="form.date2" placeholder="选择时间" style="width: 100%" />
                    </el-col>
                </el-form-item>
                <el-form-item label="立即发布">
                    <el-switch v-model="form.delivery" />
                </el-form-item>
                <el-form-item label="公告类型">
                    <el-checkbox-group v-model="form.type">
                        <el-checkbox value="Online activities" name="type">
                            餐饮安排
                        </el-checkbox>
                        <el-checkbox value="Promotion activities" name="type">
                            时间安排
                        </el-checkbox>
                        <el-checkbox value="Offline activities" name="type">
                            特殊活动
                        </el-checkbox>
                        <el-checkbox value="Simple brand exposure" name="type">
                            新闻信息
                        </el-checkbox>
                    </el-checkbox-group>
                </el-form-item>
                <el-form-item label="接收者">
                    <el-radio-group v-model="form.resource">
                        <el-radio value="nurse">职工</el-radio>
                        <el-radio value="elder">普通住户</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="公告内容">
                    <el-input v-model="form.desc" type="textarea" />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="onSubmit">确定</el-button>
                    <el-button>取消</el-button>
                </el-form-item>
            </el-form>
        </el-card>
        </el-dialog> -->

    </div>
</template>

<script setup>
// 编辑公告显示方法（未完成）
// import {ref} from 'vue'
// const editdialogVisiable=ref(false);
// const iseditdialogVisiable=()=> {
//     editdialogVisiable.value= true;
// };
const tableData = [
    {
        title: '系统维护通知',
        content: '我们将在今晚进行系统维护，届时服务可能会短暂中断。'
    },
    {
        title: '节假日安排',
        content: '根据国家节假日安排，我司将在国庆节放假七天。'
    },
    {
        title: '新政策发布',
        content: '公司将发布新的工作政策，请大家留意邮件通知。'
    },
    {
        title: '紧急会议',
        content: '由于突发事件，今天下午三点将召开紧急会议。'
    },
    {
        title: '年度总结大会',
        content: '公司将在年底举行年度总结大会，届时将回顾一年来的工作成果。'
    }
];

</script>

<style lang="less" scoped>
.el-breadcrumb {
    margin-bottom: 15px;
}

.notice-management-main {
    width: 1175px;
    height: 575px;
}

.operater-bar {
    width: 100%;
    flex-direction: row;
    display: flex;
}

.input-select-field {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    width: 750px;
}

.table-field {

    width: 100%;
    margin-top: 15px;
}

.el-input {
    width: 150px;
}

.el-select {
    width: 150px;
}

.btn-field {
    width: 350px;
    display: flex;
    justify-content: flex-end;

    >.el-button {
        margin-left: 10px;
        margin-right: 10px;
    }
}
</style>